/**
 * Copyright [2020] [LiBo/Alex of copyright liboware@gmail.com ]
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.gateway.base.error;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @project-name:gateway
 * @package-name:com.hyts.gateway.base.error
 * @author:LiBo/Alex
 * @create-date:2020-12-20 12:00
 * @copyright:libo-alex4java
 * @email:liboware@gmail.com
 * @description:
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class GatewayException extends RuntimeException {

    /**
     * 消息内容
     */
    private String message;

    /**
     * 编码
     */
    private Integer code;

    /**
     * 网关异常
     *
     * @param message
     * @param code
     */
    public GatewayException(String message, Integer code) {
        super(message);
        this.message = message;
        this.code = code;
    }

    /**
     * 网关异常
     *
     * @param message
     * @param cause
     * @param code
     */
    public GatewayException(String message, Throwable cause, Integer code) {
        super(message, cause);
        this.message = message;
        this.code = code;
    }

    /**
     * 网关异常
     *
     * @param cause
     * @param message
     * @param code
     */
    public GatewayException(Throwable cause, String message, Integer code) {
        super(cause);
        this.message = message;
        this.code = code;
    }

}
